<template>
  <div class="home">
    <router-view></router-view>
    <transition name="xxx">
      <van-tabbar
        active-color="#CE0031"
        :route="true"
        inactive-color="#B4B4BD"
        placeholder
        v-if="$route.meta.needTab"
      >
        <van-tabbar-item to="/home/company">
          <span>公司</span>
          <template #icon>
            <i class="iconfont f28">&#xe63b;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/question">
          <span>刷题</span>
          <template #icon>
            <i class="iconfont f28">&#xe63f;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/find">
          <span>发现</span>
          <template #icon>
            <i class="iconfont f28">&#xe646;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/my">
          <span>我的</span>
          <template #icon>
            <i class="iconfont f28">&#xe645;</i>
          </template>
        </van-tabbar-item>
      </van-tabbar>
    </transition>
  </div>
</template>

<script>
export default {
  data () {
    return {
      active: 3
    }
  }
}
</script>

<style lang="less" scoped>
.home {
  .f28 {
    font-size: 28px;
  }
  .xxx-enter-active {
    transition: all 2s;
  }
  .xxx-leave-active {
    transition: all 2s;
  }
  .xxx-enter {
    opacity: 0;
  }
  .xxx-leave-to {
    opacity: 0;
  }
}
</style>
